package com.mxpio.erp.common.jpa.model;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mxpio.erp.common.technology.entity.WorkShop;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 计划单据父类
 * @author MxpIO
 */
@Data
@MappedSuperclass
@EqualsAndHashCode(callSuper=false)
public abstract class BizPlan extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@Generator
	@Column(name = "PLAN_NO_", updatable = false)
	@Schema(description = "计划单号")
	private String planNo;

	@Column(name = "ITEM_CODE_", updatable = false)
	@Schema(description = "物料编码")
	private String itemCode;
	
	@Column(name = "WORK_SHOP_")
	@Schema(description = "主制车间")
	@Dict(dicCode = "workShopCode",dicEntity = WorkShop.class,dicText = "workShopName")
	private String workShop;
	
	@Column(name = "QUANTITY_")
	@Schema(description = "计划数量")
	private BigDecimal quantity;
	
	@Column(name = "START_DATE_")
	@Schema(description = "开始日期")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date startDate;
	
	@Column(name = "DELIVER_DATE_")
	@Schema(description = "交付日期")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date deliverDate;
	
	@Column(name = "MEMO_")
	@Schema(description = "备注")
	private String memo;

}
